<div class="modal-dialog">
    <div class="modal-content">
        <form role="form" method="post" id="addForm" action="{:U('manager/add')}">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">添加后台用户</h4>
            </div>
            <div class="modal-body">

                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" class="form-control" id="username" name="username">
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" class="form-control" id="password" name="password">
                </div>
                 <div class="form-group">
                    <label for="group">用户组</label>
                    <select name="group" id="group" class="form-control">
                    	<volist name="group_list" id="val">
                    		<option value="{$val.id}">{$val.name}</option>
                    	</volist>                    	
                    </select>
                </div>
                

            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-danger">确认保存</button>
            </div>
        </form>
    </div>
    <script type="text/javascript">
    	$("#addForm").bootstrapValidator({              
    	                excluded: [':disabled'],
    	                feedbackIcons: {
    	                    valid: 'glyphicon glyphicon-ok',
    	                    invalid: 'glyphicon glyphicon-remove',
    	                    validating: 'glyphicon glyphicon-refresh'
    	                },
    	                submitHandler: function (validator, form, submitButton) {
    	                 	validator.defaultSubmit();
    	                },
    	                fields: {
    	                    username: {
    	                        validators: {
    	                            notEmpty: {
    	                                message: '用户名不能为空'
    	                            },
    	                            regexp:{ 
    	                            	message: '用户名格式不正确',
    	                            	regexp: /^[a-z]\w{1,15}$/i
    	                            },
    	                            remote:{ 
    	                            	message: '用户名已存在',
    	                            	url: '{:U('manager/unique')}'
    	                            }
    	                        }
    	                    },
    	                    password:{ 
    	                    	validators: { 
    	                    		notEmpty: { 
    	                    			message: '密码不能为空'
    	                    		},
    	                    		stringLength:{ 
    	                    			message: '密码长度必须为6-16位',
    	                    			min:6,
    	                    			max:16
    	                    		}
    	                    	}
    	                    }
    	                }
    	            });
    	
    </script>